home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-28 | 3.4 KB | 116 lines | [TEXT/MPS ] |
- ;
- ; File: TranslationExtensions.a
- ;
- ; Contains: Interface definitions for translation extension writers.
- ;
- ; Copyright: © 1992-1993 by Apple Computer, Inc., all rights reserved.
- ;
- ;
-
- IF &TYPE('__INCLUDINGTRANSLATIONEXTENSIONS__') = 'UNDEFINED' THEN
- __INCLUDINGTRANSLATIONEXTENSIONS__ SET 1
-
- _TranslationDispatch opword $ABFC ; ••• move to traps.a
-
-
- ; special error codes that DoTranslateFile can return
- ;userCanceledErr EQU -128 ; user hit cancel button in progress dialog, or error handled by extension
- invalidTranslationPathErr EQU -3025 ; srcType to dstType is not a valid path ••• move into Errors.a
- couldNotParseSourceFileErr EQU -3026 ; the source document does not contain srcType ••• move into Errors.a
-
- ; attribute bits for TranslationAttributes
- taDstDocNeedsResourceFork EQU 1
- taDstIsAppTranslation EQU 2
-
-
-
- FileTypeSpec RECORD 0
- format DS.L 1 ; FileType
- hint DS.L 1 ; LONGINT
- flags DS.L 1 ; TranslationAttributes
- catInfoType DS.L 1 ; OSType
- catInfoCreator DS.L 1 ; OSType
- size EQU *
- ENDR
-
-
- FileTranslationList RECORD 0
- modDate DS.L 1 ; LONGINT
- groupCount DS.L 1 ; LONGINT
- ; group1SrcCount DS.L 1
- ; group1SrcEntrySize DS.L 1 = FileTypeSpec.size
- ; group1SrcTypes DS FileTypeSpec
- ; group1DstCount DS.L 1
- ; group1DstEntrySize DS.L 1 = FileTypeSpec.size
- ; group1DstTypes DS FileTypeSpec
- size EQU *
- ENDR
-
-
- ScrapTypeSpec RECORD 0
- format DS.L 1 ; FileType
- hint DS.L 1 ; LONGINT
- size EQU *
- ENDR
-
-
- ScrapTranslationList RECORD 0
- modDate DS.L 1 ; LONGINT
- groupCount DS.L 1 ; LONGINT
- ; group1SrcCount DS.L 1
- ; group1SrcEntrySize DS.L 1 = ScrapTypeSpec.size
- ; group1SrcTypes DS ScrapTypeSpec
- ; group1DstCount DS.L 1
- ; group1DstEntrySize DS.L 1 = ScrapTypeSpec.size
- ; group1DstTypes DS ScrapTypeSpec
- size EQU *
- ENDR
-
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;
- ; This routine sets the advertisement in the top half of the progress dialog.
- ; It is called once at the beginning of your DoTranslateFile routine.
- ;
- ; Enter: refNum Translation reference supplied to DoTranslateFile.
- ; advertisement A handle to the picture to display. This must be non-purgable.
- ; Before returning from DoTranslateFile, you should dispose
- ; of the memory. (Normally, it is in the temp translation heap
- ; so it is cleaned up for you.)
- ;
- ; Exit: returns noErr, paramErr, or memFullErr
- ;
- ; FUNCTION SetTranslationAdvertisement( refNum : TranslationRefNum;
- ; advertisement : PicHandle): OSErr;
- MACRO
- _SetTranslationAdvertisement
- MOVEQ #2,D0
- _TranslationDispatch
- ENDM
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;
- ; This routine updates the progress bar in the progress dialog.
- ; It is only called from within your DoTranslateFile routine.
- ; It should be called often, so that the user will get feedback if he tries to cancel.
- ;
- ; Enter: refNum translation reference supplied to DoTranslateFile.
- ; progress percent complete (0-100)
- ;
- ; Exit: canceled TRUE if the user clicked the Cancel button, FALSE otherwise
- ; returns noErr, paramErr, or memFullErr
- ;
- ; FUNCTION UpdateTranslationProgress( refNum : TranslationRefNum;
- ; percentDone : INTEGER;
- ; VAR canceled : Boolean): OSErr;
- MACRO
- _UpdateTranslationProgress
- MOVEQ #1,D0
- _TranslationDispatch
- ENDM
-
- ENDIF ; ...already included
-
-